<?php
include_once('common/header.php');			
if($AppUI->id <=0 || !isset($_SERVER['HTTP_REFERER'])) {
	Vfriend_Function::redirect(HOST_VFRIEND);
}
$strRefer	= isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$intNewsId	= $objRequest->getParam('newsid', 0);
$strToken	= $objRequest->getParam('token', '');
$strSession	= Vfriend_Function::getSecret($intNewsId, SE_NEWS_FOLLOW);
$intError	= 0;
if($intError == 0 && $intNewsId && $strToken != '' && $strToken == $strSession && Vfriend_Function::isValidLink($strRefer)) {
	Vfriend_Function::deleteSecret($intNewsId, SE_NEWS_FOLLOW);
	$objNews	= new News();
	$objNews->addFollow($AppUI->id, $intNewsId);
	Vfriend_Function::setMsg($arrMessage[13]);
	
} else {
	$intError = 18;
}
if($intError > 0) {
	$strError = $arrError[$intError];	
	Vfriend_Function::setError($strError);	
}
Vfriend_Function::redirect($strRefer ? $strRefer : LINK_NEWS);
?>
